3 * https://www.mediawiki.org/wiki/OOUI
5 * Copyright 2011–2019 OOUI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2019-03-07T09:14:18Z
17 * @extends OO.ui.Theme
21 OO
.ui
.WikimediaUITheme
= function OoUiWikimediaUITheme() {
23 OO
.ui
.WikimediaUITheme
.parent
.call( this );
28 OO
.inheritClass( OO
.ui
.WikimediaUITheme
, OO
.ui
.Theme
);
35 OO
.ui
.WikimediaUITheme
.prototype.getElementClasses = function ( element
) {
37 var variant
, isFramed
, isActive
, isToolOrGroup
,
46 classes
= OO
.ui
.WikimediaUITheme
.parent
.prototype.getElementClasses
.call( this, element
);
49 element
instanceof OO
.ui
.IconWidget
&&
50 element
.$element
.hasClass( 'oo-ui-checkboxInputWidget-checkIcon' )
52 // Icon on CheckboxInputWidget
53 variants
.invert
= true;
54 } else if ( element
.supports( [ 'hasFlag' ] ) ) {
55 isFramed
= element
.supports( [ 'isFramed' ] ) && element
.isFramed();
56 isActive
= element
.supports( [ 'isActive' ] ) && element
.isActive();
58 // Check if the class exists, as classes that are not in the 'core' module may
60 ( OO
.ui
.Tool
&& element
instanceof OO
.ui
.Tool
) ||
61 ( OO
.ui
.ToolGroup
&& element
instanceof OO
.ui
.ToolGroup
);
63 // Button with a dark background.
64 isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ||
65 // Toolbar with a dark background.
66 isToolOrGroup
&& element
.hasFlag( 'primary' )
68 // … use white icon / indicator, regardless of other flags
69 variants
.invert
= true;
70 } else if ( !isFramed
&& element
.isDisabled() ) {
71 // Frameless disabled button, always use black icon / indicator regardless of
73 variants
.invert
= false;
74 } else if ( !element
.isDisabled() ) {
75 // Any other kind of button, use the right colored icon / indicator if available.
76 variants
.progressive
= element
.hasFlag( 'progressive' ) ||
77 // Active tools/toolgroups
78 ( isToolOrGroup
&& isActive
) ||
79 // Pressed or selected outline/menu option widgets
82 element
instanceof OO
.ui
.MenuOptionWidget
||
83 // Check if the class exists, as classes that are not in the 'core' module
86 OO
.ui
.OutlineOptionWidget
&&
87 element
instanceof OO
.ui
.OutlineOptionWidget
90 ( element
.isPressed() || element
.isSelected() )
93 variants
.destructive
= element
.hasFlag( 'destructive' );
94 variants
.error
= element
.hasFlag( 'error' );
95 variants
.warning
= element
.hasFlag( 'warning' );
99 for ( variant
in variants
) {
100 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
109 OO
.ui
.WikimediaUITheme
.prototype.getDialogTransitionDuration = function () {
115 OO
.ui
.theme
= new OO
.ui
.WikimediaUITheme();
119 //# sourceMappingURL=oojs-ui-wikimediaui.js.map.json